/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * @BarCodeInline.java
 * 汇智互联版权所有，未经许可，不得使用
 */

package com.wisii.wisedoc.document;

import java.util.Map;

import com.wisii.wisedoc.document.attribute.Attributes;

/**
 * 类功能描述：
 * 
 * 作者：zhangqiang 创建日期：2008-10-24
 */
public class BarCodeInline extends Inline
{
	public BarCodeInline()
	{
	}

	public BarCodeInline(final Map<Integer,Object> attributes)
	{
		super(null);
		add(new BarCode(attributes));
	}
    public Attributes getAttributes()
    {
    	return NULLATTRIBUTES;
    }
	protected void SetInlineContent(Object inlinecontent)
	{
		if (inlinecontent instanceof BarCodeText)
		{
			getChildAt(0).setAttribute(Constants.PR_BARCODE_CONTENT,
					inlinecontent);
		} else if (inlinecontent instanceof InlineContent)
		{
			getChildAt(0).setAttribute(
					Constants.PR_BARCODE_CONTENT,
					new BarCodeText(((InlineContent) inlinecontent)
							.getBindNode()));
		} else if (inlinecontent == null)
		{
			getChildAt(0).setAttribute(Constants.PR_BARCODE_CONTENT, null);
		}
	}
	/**
	 * 
	 * 获得Inline的内容的接口
	 * 
	 * @param
	 * @return Inline对象的内容
	 * @exception
	 */
	@Override
	public InlineContent getContent()
	{
		return (InlineContent) getChildAt(0).getAttribute(Constants.PR_BARCODE_CONTENT);
	}
}
